(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     63364,       2126]
NotebookOptionsPosition[     58599,       1966]
NotebookOutlinePosition[     59374,       1995]
CellTagsIndexPosition[     59246,       1989]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{
    "===", "===", "===", "===", "===", "===", "===", "===", "===", "===", "===",
      "===", "===", "===", "===", "===", "===", "===", "===", "===", "===", "===",
      "===", "===", "===", "\[IndentingNewLine]", "   ", 
     RowBox[{
     "\"\<By Example\>\"", " ", "introduction", " ", "into", " ", "the", " ", 
      "Mathematica", " ", "PairwiseComparisons`", " ", "Package", 
      "\[IndentingNewLine]", "   ", "Konrad", " ", "Ku\[LSlash]akowski", " ", 
      
      RowBox[{"(", "C", ")"}], " ", "2014"}]}], ",", " ", 
    "\[IndentingNewLine]", "     ", 
    RowBox[{"e", "-", 
     RowBox[{"mail", ":", " ", 
      RowBox[{
       RowBox[{
        RowBox[{"konrad", "@", "kulakowski"}], ".", "org"}], 
       "\[IndentingNewLine]", " ", "\[IndentingNewLine]", "  ", "The", " ", 
       "package", " ", "and", " ", "documentation", " ", "is", " ", 
       "available", " ", "under", " ", "\[IndentingNewLine]", "  ", "GNU", 
       " ", "General", " ", "Public", " ", "Licence"}]}]}], ",", "  ", 
    "\[IndentingNewLine]", "     ", 
    RowBox[{
     RowBox[{"see", ":", " ", "http", ":"}], "//", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"www", ".", "gnu", ".", "org"}], "/", "copyleft"}], "/", 
       RowBox[{"gpl", ".", "html"}]}], "\[IndentingNewLine]", "===", "===", "===",
       "===", "===", "===", "===", "===", "===", "===", "===", "===", "===", "===",
       "===", "===", "===", "===", "===", "===", "===", "===", "===", "===", 
      "==="}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
     RowBox[{
      RowBox[{
      "To", " ", "install", " ", "the", " ", "package", " ", "on", " ", "the",
        " ", "computer", " ", "start", " ", "Mathematica", " ", "and", " ", 
       "choose", " ", "\[IndentingNewLine]", " ", 
       RowBox[{"File", "/", "Install"}]}], "..."}], ",", " ", 
     RowBox[{"then", " ", "select", " ", 
      RowBox[{"PairwiseComparisons", ".", "m"}], " ", "as", " ", "the", " ", 
      "package", "  ", " ", "\[IndentingNewLine]", "  ", "source", " ", "and",
       " ", "press", " ", 
      RowBox[{"OK", "."}]}]}], " ", "*)"}],
   FontWeight->"Bold"], 
  StyleBox["\[IndentingNewLine]",
   FontWeight->"Bold"], 
  StyleBox["\[IndentingNewLine]",
   FontWeight->"Bold"], 
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "To", " ", "install", " ", "the", " ", "package", " ", "at", " ", "the", 
     " ", "Raspberry", " ", "PI", " ", "just", " ", "copy", " ", "them", " ", 
     "\[IndentingNewLine]", "  ", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"into", " ", "/", "opt"}], "/", "Wolfram"}], "/", 
         "WolframEngine"}], "/", "10.0"}], "/", "AddOns"}], "/", 
      "ExtraPackages"}], "  ", " ", "\[IndentingNewLine]", "  ", "and", " ", 
     "restart", " ", "the", " ", "application"}], " ", "*)"}],
   FontWeight->"Bold"], "\[IndentingNewLine]"}]], "Input"],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{"Loading", " ", "the", " ", "package"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[BoxData[
 StyleBox[
  RowBox[{"<<", " ", "PairwiseComparisons`"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 StyleBox[
  RowBox[{
   RowBox[{"(*", " ", 
    RowBox[{"Printing", " ", "function", " ", "usage"}], " ", "*)"}], 
   "\[IndentingNewLine]"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{3.610958731816001*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"?", " ", "KoczkodajIdx"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 StyleBox["\<\"KoczkodajIdx[M] returns the value of the Koczkodaj \
inconsistency computed for the matrix M\"\>", "MSG"]], "Print", "PrintUsage",
 CellChangeTimes->{3.6109610457129507`*^9},
 CellTags->"Info3610961044-2025015"]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{"Printing", " ", "full", " ", 
    RowBox[{"(", 
     RowBox[{"with", " ", "implementation"}], ")"}], " ", "function", " ", 
    "usage"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"??", " ", "KoczkodajIdx"}],
  FontWeight->"Plain"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox["\<\"KoczkodajIdx[M] returns the value of the Koczkodaj \
inconsistency computed for the matrix M\"\>", "MSG"]], "Print", "PrintUsage",
 CellChangeTimes->{3.6109610483953*^9},
 CellTags->"Info3610961047-2025015"],

Cell[BoxData[
 InterpretationBox[GridBox[{
    {GridBox[{
       {
        RowBox[{
         RowBox[{
         "KoczkodajIdx", "[", "PairwiseComparisons`Private`matrix_", "]"}], ":=", 
         RowBox[{"Last", "[", 
          RowBox[{
          "KoczkodajTheWorstTriad", "[", "PairwiseComparisons`Private`matrix",
            "]"}], "]"}]}]}
      },
      BaselinePosition->{Baseline, {1, 1}},
      GridBoxAlignment->{
       "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
        "RowsIndexed" -> {}},
      GridBoxItemSize->{"Columns" -> {{
           Scaled[0.999]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
        "RowsIndexed" -> {}}]}
   },
   BaselinePosition->{Baseline, {1, 1}},
   GridBoxAlignment->{
    "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
     "RowsIndexed" -> {}}],
  Definition[PairwiseComparisons`KoczkodajIdx],
  Editable->False]], "Print",
 CellChangeTimes->{3.610961048479226*^9},
 CellTags->"Info3610961047-2025015"]
}, Open  ]]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Print", " ", "all", " ", "the", " ", "public", " ", "functions", " ", 
    "in", " ", "the", " ", "package"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"?", "PairwiseComparisons`*"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 DynamicModuleBox[{Typeset`open$$ = True}, 
  PaneSelectorBox[{False->
   RowBox[{
    OpenerBox[Dynamic[Typeset`open$$],
     ImageSize->Small], 
    StyleBox["PairwiseComparisons`", "InfoHeading"]}], True->GridBox[{
     {
      RowBox[{
       OpenerBox[Dynamic[Typeset`open$$],
        ImageSize->Small], 
       StyleBox["PairwiseComparisons`", "InfoHeading"]}]},
     {GridBox[{
        {
         ButtonBox["COP1Check",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"COP1Check", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["EigenvalueRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "EigenvalueRank", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["HREPartialRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "HREPartialRank", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajTriadIdx",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "KoczkodajTriadIdx", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["COP1ViolationList",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "COP1ViolationList", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["GeometricRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "GeometricRank", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["HRERescaledRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "HRERescaledRank", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["PrincipalEigenValue",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "PrincipalEigenValue", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["COP2Check",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"COP2Check", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["GeometricRescaledRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "GeometricRescaledRank", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajConsistentTriad",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "KoczkodajConsistentTriad", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["PrincipalEigenVector",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "PrincipalEigenVector", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["COP2ViolationList",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "COP2ViolationList", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["GetMatrixEntry",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "GetMatrixEntry", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajIdx",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"KoczkodajIdx", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["RankToVector",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"RankToVector", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["DeleteColumns",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "DeleteColumns", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["HREConstantTermVector",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "HREConstantTermVector", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajImproveMatrixStep",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "KoczkodajImproveMatrixStep", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["RecreatePCMatrix",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "RecreatePCMatrix", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["DeleteRows",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"DeleteRows", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["HREFullRank",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"HREFullRank", "PairwiseComparisons`"}},
          
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajTheWorstTriad",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "KoczkodajTheWorstTriad", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["SaatyIdx",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"SaatyIdx", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"]},
        {
         ButtonBox["DeleteRowsAndColumns",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "DeleteRowsAndColumns", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["HREMatrix",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"HREMatrix", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["KoczkodajTheWorstTriads",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {
            "KoczkodajTheWorstTriads", "PairwiseComparisons`"}},
          ButtonNote->"PairwiseComparisons`"], 
         ButtonBox["SetDiagonal",
          BaseStyle->"InformationLink",
          
          ButtonData:>{
           "Info3610961049-2025015", {"SetDiagonal", "PairwiseComparisons`"}},
          
          ButtonNote->"PairwiseComparisons`"]}
       },
       DefaultBaseStyle->"InfoGrid",
       GridBoxItemSize->{"Columns" -> {{
            Scaled[0.2375]}}}]}
    },
    GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}]}, 
   Dynamic[Typeset`open$$],
   ImageSize->Automatic]]], "Print", "InfoCell",
 CellChangeTimes->{3.6109610507058496`*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Assign", " ", "the", " ", "matrix", " ", "to", " ", "the", " ", 
    "variable", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"M", "=", 
   FormBox[
    RowBox[{"(", "\[NoBreak]", GridBox[{
       {"1", "2", "3"},
       {
        FractionBox["1", "2"], "1", "4"},
       {
        FractionBox["1", "3"], 
        FractionBox["1", "4"], "1"}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
        "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.7]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
    TraditionalForm]}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["1", "2"], ",", "1", ",", "4"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["1", "3"], ",", 
     FractionBox["1", "4"], ",", "1"}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.610958822640921*^9, 3.610961053105085*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "principal", " ", "eigenvalue", " ", "of", 
    " ", "the", " ", "matrix", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"PrincipalEigenValue", "[", "M", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData["3.1078473338549735`"], "Output",
 CellChangeTimes->{3.6109588369193773`*^9, 3.610961054702477*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "principal", " ", "eigenvector", " ", "of", 
    " ", "the", " ", "matrix", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"PrincipalEigenVector", "[", "M", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"4.160167646103795`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.`", " ", "\[ImaginaryI]"}]}], ",", 
   RowBox[{"2.8844991406147376`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.`", " ", "\[ImaginaryI]"}]}], ",", "1.`"}], "}"}]], "Output",
 CellChangeTimes->{3.610958862054473*^9, 3.6109610597992496`*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "value", " ", "of", " ", "the", " ", "Saaty",
     " ", 
    RowBox[{"(", 
     RowBox[{"eigenvalue", " ", "based"}], ")"}], " ", "inconsistency", " ", 
    "index", " ", "of", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"SaatyIdx", "[", "M", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData["0.053923666927486735`"], "Output",
 CellChangeTimes->{3.610958885556662*^9, 3.610961062003024*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "eigenvalue", " ", "based", " ", "ranking", 
    " ", "based", " ", "on", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{{3.610958920766711*^9, 3.6109589259184427`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"EigenvalueRank", "[", "M", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"0.5171336186319224`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.`", " ", "\[ImaginaryI]"}]}], ",", 
   RowBox[{"0.35856042482417616`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.`", " ", "\[ImaginaryI]"}]}], ",", 
   RowBox[{"0.12430595654390128`", "\[VeryThinSpace]", "+", 
    RowBox[{"0.`", " ", "\[ImaginaryI]"}]}]}], "}"}]], "Output",
 CellChangeTimes->{3.610958940937582*^9, 3.610961063739395*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Calculate", " ", "the", " ", "geometric", " ", "mean", " ", "based", " ", 
   "ranking", " ", "based", " ", "on", " ", "M"}], " ", "*)"}]], "Input",
 CellChangeTimes->{{3.6109589555140343`*^9, 3.610958959080544*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"N", "[", 
   RowBox[{"GeometricRank", "[", "M", "]"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "1.8171205928321397`", ",", "1.2599210498948732`", ",", 
   "0.4367902323681495`"}], "}"}]], "Output",
 CellChangeTimes->{3.610958972469926*^9, 3.61096106491779*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "geometric", " ", "mean", " ", "based", " ", 
    "ranking", " ", "based", " ", "on", " ", "M", " ", "rescaled", " ", "so", 
    " ", "that", " ", "the", " ", "sum", " ", "of", " ", "entries", " ", "is",
     " ", "1"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{{3.6109589913716288`*^9, 3.6109589926682796`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"N", "[", 
   RowBox[{"GeometricRescaledRank", "[", "M", "]"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "0.5171336186319182`", ",", "0.35856042482418193`", ",", 
   "0.12430595654389989`"}], "}"}]], "Output",
 CellChangeTimes->{3.6109590031519127`*^9, 3.610961067232546*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{
   StyleBox["(*",
    FontWeight->"Plain"], 
   StyleBox[" ",
    FontWeight->"Plain"], 
   RowBox[{
   "Calculate", " ", "the", " ", "HRE", " ", "Matrix", " ", "for", " ", "the",
     " ", "given", " ", "matrix", " ", "M", " ", "where", " ", "the", " ", 
    "unknown", " ", "concepts", " ", "are", 
    StyleBox[" ",
     FontWeight->"Plain"], 
    RowBox[{"{", 
     RowBox[{
      SubscriptBox["c", "1"], ",", 
      SubscriptBox["c", "2"], ",", 
      SubscriptBox["c", "3"]}], "}"}], 
    StyleBox[" ",
     FontWeight->"Plain"], "and", " ", "the", " ", "known", " ", "concepts", 
    " ", "are", 
    StyleBox[" ",
     FontWeight->"Plain"], 
    RowBox[{
     StyleBox[
      RowBox[{"{", 
       RowBox[{
        RowBox[{
         SubscriptBox["c", "4"], "=", "5"}], ",", 
        RowBox[{
         SubscriptBox["c", "5"], "=", "9"}]}], "}"}],
      FontWeight->"Plain"], 
     StyleBox[".",
      FontWeight->"Plain"], 
     StyleBox[" ",
      FontWeight->"Plain"], "It"}], " ", "is", " ", "assumed", " ", "that", 
    " ", "the", " ", "unknown", " ", "concepts", " ", "has", " ", "value", 
    " ", "0", " ", "whilst", " ", "the", " ", "known", " ", "concepts", " ", 
    "have", " ", "the", " ", "values", " ", "greater", " ", "than", 
    StyleBox[" ",
     FontWeight->"Plain"], 
    StyleBox["0.",
     FontWeight->"Plain"]}], 
   StyleBox[" ",
    FontWeight->"Plain"], 
   StyleBox["*)",
    FontWeight->"Plain"]}], 
  StyleBox["\[IndentingNewLine]",
   FontWeight->"Plain"], 
  StyleBox["\[IndentingNewLine]",
   FontWeight->"Plain"], 
  RowBox[{
   StyleBox["(*",
    FontWeight->"Plain"], 
   StyleBox[" ",
    FontWeight->"Plain"], 
   RowBox[{
    RowBox[{
    "Further", " ", "references", " ", "could", " ", "be", " ", "found", " ", 
     "in", 
     StyleBox[" ",
      FontWeight->"Plain"], 
     RowBox[{"papers", ":", "\[IndentingNewLine]", "  ", 
      RowBox[{"*", " ", "Konrad", " ", "Ku\[LSlash]akowski"}]}]}], ",", " ", 
    RowBox[{
     RowBox[{
     "Heuristic", " ", "Rating", " ", "Estimation", " ", "Approach", " ", 
      "to", " ", "The", " ", "Pairwise", " ", "Comparisons", " ", "Method", 
      " ", 
      StyleBox["\[IndentingNewLine]",
       FontWeight->"Plain"], 
      StyleBox["    ",
       FontWeight->"Plain"], 
      RowBox[{"http", ":"}]}], "//", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"arxiv", ".", "org"}], "/", "abs"}], "/", "1309.0386"}], "  ",
       "\[IndentingNewLine]", "  ", "*", " ", "Konrad", " ", 
      "Ku\[LSlash]akowski"}]}], ",", " ", 
    RowBox[{
     RowBox[{
     "A", " ", "heuristic", " ", "rating", " ", "estimation", " ", 
      "algorithm", " ", "for", " ", "the", " ", "pairwise", " ", 
      "comparisons", " ", "method", "\[IndentingNewLine]", "    ", 
      RowBox[{"http", ":"}]}], "//", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"dx", ".", "doi", ".", "org"}], "/", "10.1007"}], "/", 
       "s10100"}], "-", "013", "-", "0311", "-", "x"}]}]}], "   ", 
   "\[IndentingNewLine]", 
   StyleBox["*)",
    FontWeight->"Plain"]}]}]], "Input",
 CellChangeTimes->{{3.610959049586088*^9, 3.610959080248348*^9}, {
  3.610959178036406*^9, 3.6109592436962967`*^9}, {3.610959292476379*^9, 
  3.610959376372218*^9}, {3.610959463942563*^9, 3.610959572617002*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"HREMatrix", "[", 
   RowBox[{
    FormBox[
     RowBox[{"(", "\[NoBreak]", GridBox[{
        {
         SubscriptBox["m", 
          RowBox[{"1", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"2", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"3", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"4", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"5", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "5"}]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
         "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.7]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
     TraditionalForm], ",", 
    RowBox[{"(", "\[NoBreak]", GridBox[{
       {"0"},
       {"0"},
       {"0"},
       {"5"},
       {"9"}
      }], "\[NoBreak]", ")"}]}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", 
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"1", ",", "2"}]], "4"]}], ",", 
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"1", ",", "3"}]], "4"]}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"2", ",", "1"}]], "4"]}], ",", "1", ",", 
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"2", ",", "3"}]], "4"]}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"3", ",", "1"}]], "4"]}], ",", 
     RowBox[{"-", 
      FractionBox[
       SubscriptBox["m", 
        RowBox[{"3", ",", "2"}]], "4"]}], ",", "1"}], "}"}]}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.610959394142329*^9, 3.61095940520299*^9}, 
   3.610961068212962*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  StyleBox["(*",
   FontWeight->"Bold"], 
  StyleBox[" ",
   FontWeight->"Bold"], 
  RowBox[{
   StyleBox["Calculate",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["the",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["HRE",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["constant",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["term",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["vector",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["for",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["M",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["where",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox[
    SubscriptBox[
     StyleBox["C",
      FontWeight->"Plain"], "U"],
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox["equals",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox[
    RowBox[{"{", 
     RowBox[{
      SubscriptBox["c", "1"], ",", 
      SubscriptBox["c", "2"], ",", 
      SubscriptBox["c", "3"]}], "}"}],
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Plain"], "and", 
   StyleBox[" ",
    FontWeight->"Plain"], 
   StyleBox[
    SubscriptBox[
     StyleBox["C",
      FontWeight->"Plain"], 
     RowBox[{"K", " "}]],
    FontWeight->"Bold"], 
   StyleBox["equals",
    FontWeight->"Bold"], 
   StyleBox[" ",
    FontWeight->"Bold"], 
   StyleBox[
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       SubscriptBox["c", "4"], "=", "5"}], ",", 
      RowBox[{
       SubscriptBox["c", "5"], "=", "9"}]}], "}"}],
    FontWeight->"Bold"]}], 
  StyleBox[" ",
   FontWeight->"Bold"], 
  StyleBox["*)",
   FontWeight->"Bold"]}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"HREConstantTermVector", "[", 
   RowBox[{
    FormBox[
     RowBox[{"(", "\[NoBreak]", GridBox[{
        {
         SubscriptBox["m", 
          RowBox[{"1", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"1", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"2", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"2", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"3", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"3", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"4", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"4", ",", "5"}]]},
        {
         SubscriptBox["m", 
          RowBox[{"5", ",", "1"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "2"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "3"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "4"}]], 
         SubscriptBox["m", 
          RowBox[{"5", ",", "5"}]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
         "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.7]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
     TraditionalForm], ",", 
    RowBox[{"(", "\[NoBreak]", GridBox[{
       {"0"},
       {"0"},
       {"0"},
       {"5"},
       {"9"}
      }], "\[NoBreak]", ")"}]}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     FractionBox[
      RowBox[{"5", " ", 
       SubscriptBox["m", 
        RowBox[{"1", ",", "4"}]]}], "4"], "+", 
     FractionBox[
      RowBox[{"9", " ", 
       SubscriptBox["m", 
        RowBox[{"1", ",", "5"}]]}], "4"]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox[
      RowBox[{"5", " ", 
       SubscriptBox["m", 
        RowBox[{"2", ",", "4"}]]}], "4"], "+", 
     FractionBox[
      RowBox[{"9", " ", 
       SubscriptBox["m", 
        RowBox[{"2", ",", "5"}]]}], "4"]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox[
      RowBox[{"5", " ", 
       SubscriptBox["m", 
        RowBox[{"3", ",", "4"}]]}], "4"], "+", 
     FractionBox[
      RowBox[{"9", " ", 
       SubscriptBox["m", 
        RowBox[{"3", ",", "5"}]]}], "4"]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.610959429317706*^9, 3.6109594362991323`*^9}, 
   3.6109610704460382`*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Auxiliary", " ", "function", " ", "that", " ", "transform", " ", "an", " ",
    "upper", " ", "triangle", " ", "matrix", " ", "into", " ", "a", " ", 
   "full", " ", "and", " ", "reciprocal", " ", "matrix"}], " ", 
  "*)"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"M", " ", "=", " ", 
   RowBox[{"RecreatePCMatrix", "[", 
    FormBox[
     RowBox[{"(", "\[NoBreak]", GridBox[{
        {"1", 
         FractionBox["3", "5"], 
         FractionBox["4", "7"], 
         FractionBox["5", "8"], 
         FractionBox["5", "10"]},
        {"0", "1", 
         FractionBox["5", "7"], 
         FractionBox["5", "2"], 
         FractionBox["10", "3"]},
        {"0", "0", "1", 
         FractionBox["7", "2"], "4"},
        {"0", "0", "0", "1", 
         FractionBox["4", "3"]},
        {"0", "0", "0", "0", "1"}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
         "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.7]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
     TraditionalForm], "]"}]}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", 
     FractionBox["3", "5"], ",", 
     FractionBox["4", "7"], ",", 
     FractionBox["5", "8"], ",", 
     FractionBox["1", "2"]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["5", "3"], ",", "1", ",", 
     FractionBox["5", "7"], ",", 
     FractionBox["5", "2"], ",", 
     FractionBox["10", "3"]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["7", "4"], ",", 
     FractionBox["7", "5"], ",", "1", ",", 
     FractionBox["7", "2"], ",", "4"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["8", "5"], ",", 
     FractionBox["2", "5"], ",", 
     FractionBox["2", "7"], ",", "1", ",", 
     FractionBox["4", "3"]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2", ",", 
     FractionBox["3", "10"], ",", 
     FractionBox["1", "4"], ",", 
     FractionBox["3", "4"], ",", "1"}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.610959605820106*^9, 3.6109596130070877`*^9}, 
   3.610961071458962*^9}]
}, Open  ]],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.610959688477159*^9, 3.6109596921470613`*^9}}],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{"Defining", " ", "known", " ", "and", " ", "unknown", " ", 
   RowBox[{"alternatives", ".", " ", "It"}], " ", "is", " ", "assumed", " ", 
   "that", " ", 
   SubscriptBox["c", "2"], " ", "and", " ", 
   SubscriptBox["c", "3"], " ", "are", " ", "known", " ", "and", " ", "equal",
    " ", "5", " ", "and", " ", "7", " ", "correspondingly"}], " ", 
  "*)"}]], "Input",
 CellChangeTimes->{{3.610959694625154*^9, 3.6109598065273533`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"mk", " ", "=", " ", 
   RowBox[{"(", "\[NoBreak]", GridBox[{
      {"0"},
      {"5"},
      {"7"},
      {"0"},
      {"0"}
     }], "\[NoBreak]", ")"}]}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", "0", "}"}], ",", 
   RowBox[{"{", "5", "}"}], ",", 
   RowBox[{"{", "7", "}"}], ",", 
   RowBox[{"{", "0", "}"}], ",", 
   RowBox[{"{", "0", "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.610959727981371*^9, 3.610961072657395*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{
   "Calculate", " ", "the", " ", "HRE", " ", "ranking", " ", "vector", " ", 
    "for", " ", "unknown", " ", "alternatives", " ", 
    RowBox[{"i", ".", "e", ".", " ", "for"}], " ", 
    SubscriptBox["c", "1"]}], ",", 
   RowBox[{
    SubscriptBox["c", "4"], " ", "and", " ", 
    SubscriptBox["c", "5"], " ", "only"}]}], " ", "*)"}]], "Input",
 CellChangeTimes->{
  3.610959856381365*^9, {3.610960021134193*^9, 3.610960023493642*^9}, {
   3.610960061799532*^9, 3.610960062802446*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"mu", " ", "=", " ", 
   RowBox[{"N", "[", 
    RowBox[{"HREPartialRank", "[", 
     RowBox[{"M", ",", "mk"}], "]"}], "]"}]}],
  FontWeight->"Plain"]], "Input",
 CellChangeTimes->{{3.610960036391541*^9, 3.610960037669932*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", "2.52764745308311`", "}"}], ",", 
   RowBox[{"{", "2.883378016085791`", "}"}], ",", 
   RowBox[{"{", "2.616957104557641`", "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.610959841904636*^9, 3.610960038268107*^9, 
  3.610960082565969*^9, 3.610961073537097*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "full", " ", "HRE", " ", "ranking", " ", 
    "for", " ", "the", " ", "given", " ", "input", " ", "matrix", " ", "M", 
    " ", "and", " ", "the", " ", "vector", " ", "mk"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{{3.610959893050642*^9, 3.610959929762821*^9}, 
   3.610960027228586*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"mu", " ", "=", " ", 
   RowBox[{"N", "[", 
    RowBox[{"HREFullRank", "[", 
     RowBox[{"M", ",", "mk"}], "]"}], "]"}]}],
  FontWeight->"Plain"]], "Input",
 CellChangeTimes->{{3.610960031702169*^9, 3.610960041052114*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "2.52764745308311`", ",", "5.`", ",", "7.`", ",", "2.883378016085791`", ",",
    "2.616957104557641`"}], "}"}]], "Output",
 CellChangeTimes->{3.61095995261969*^9, 3.610960041691843*^9, 
  3.610961075151431*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Let", " ", "calculate", " ", "the", " ", "eigenvalue", " ", "ranking"}], 
  " ", "*)"}]], "Input",
 CellChangeTimes->{
  3.610960103018318*^9, {3.610960173830368*^9, 3.6109601847407093`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"rank", " ", "=", " ", 
   RowBox[{"EigenvalueRank", "[", "M", "]"}]}],
  FontWeight->"Plain"]], "Input",
 CellChangeTimes->{{3.610960190900632*^9, 3.610960196389434*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "0.11909159984125188`", ",", "0.27475988422762304`", ",", 
   "0.35652551848899955`", ",", "0.13095370938584494`", ",", 
   "0.1186692880562805`"}], "}"}]], "Output",
 CellChangeTimes->{3.610960197310574*^9, 3.610961078440753*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "and", " ", "check", " ", "whether", " ", "the", " ", "first", " ", "Bana",
     " ", "e", " ", "Costa", " ", "and", " ", "Vansnick", " ", "condition", 
    " ", "\"\<condition of order preservation - COP\>\"", "  ", "is", " ", 
    "satisfied"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{{3.610960219697904*^9, 3.6109602221085863`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"COP1Check", "[", 
   RowBox[{"M", ",", "mu"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData["True"], "Output",
 CellChangeTimes->{3.610960230688883*^9, 3.610961080517679*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "then", " ", "check", " ", "whether", " ", "the", " ", "second", " ", 
   "Bana", " ", "e", " ", "Costa", " ", "and", " ", "Vansnick", " ", 
   "condition", " ", 
   RowBox[{"(", 
    RowBox[{
    "preserving", " ", "intensity", " ", "of", " ", "preferences", " ", 
     "postulate"}], ")"}], " ", "is", " ", "satisfied"}], " ", 
  "*)"}]], "Input",
 CellChangeTimes->{{3.610960251453055*^9, 3.6109602790729227`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"COP2Check", "[", 
   RowBox[{"M", ",", "mu"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData["False"], "Output",
 CellChangeTimes->{3.610960287725429*^9, 3.610961081862339*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Prints", " ", "the", " ", "list", " ", "of", " ", "pairs", " ", "for", " ",
    "which", " ", "the", " ", "1", "st", " ", "COP", " ", "is", " ", "not", 
   " ", "satisfied"}], " ", "*)"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"COP1ViolationList", "[", 
   RowBox[{"M", ",", "mu"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", "}"}]], "Output",
 CellChangeTimes->{3.61096030905459*^9, 3.610961082862097*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Prints", " ", "the", " ", "list", " ", "of", " ", "pairs", " ", "of", " ", 
   "pairs", " ", "for", " ", "which", " ", "the", " ", "2", "nd", " ", "COP", 
   " ", "is", " ", "not", " ", "satisfied"}], " ", "*)"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"COP2ViolationList", "[", 
   RowBox[{"M", ",", "mu"}], "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"2", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "4"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"3", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"4", ",", "5"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"2", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "1"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"4", ",", "5"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "2"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "3"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"False", ",", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"5", ",", "4"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "5"}], "}"}]}], "}"}]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.610960323488151*^9, 3.610961084615758*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Calculate", " ", "the", " ", "value", " ", "of", " ", "the", " ", 
    "Koczkodaj", " ", "inconsistency", " ", "index"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input",
 CellChangeTimes->{{3.610960353726194*^9, 3.610960356565077*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"N", "[", 
   RowBox[{"KoczkodajIdx", "[", "M", "]"}], "]"}],
  FontWeight->"Plain"]], "Input",
 CellChangeTimes->{{3.610960619361732*^9, 3.610960621152897*^9}}],

Cell[BoxData["0.78125`"], "Output",
 CellChangeTimes->{3.610960370032226*^9, 3.610960621595873*^9, 
  3.610961085856598*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  StyleBox["(*",
   FontWeight->"Bold"], 
  StyleBox[" ",
   FontWeight->"Bold"], 
  RowBox[{
   RowBox[{
    RowBox[{
     StyleBox["Prints",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["the",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["worst",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["Koczkodaj",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["triad",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["in",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox[
      RowBox[{"M", ".", " ", "As"}],
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["we",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["can",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["see",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["it",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["is",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Plain"], 
     StyleBox[
      SubscriptBox[
       StyleBox["m",
        FontWeight->"Plain"], 
       RowBox[{"5", ",", "3"}]],
      FontWeight->"Plain"]}], 
    StyleBox["==",
     FontWeight->"Plain"], 
    StyleBox[
     FractionBox["1", "4"],
     FontWeight->"Plain"]}], 
   StyleBox[",",
    FontWeight->"Plain"], 
   StyleBox[
    RowBox[{
     SubscriptBox["m", 
      RowBox[{"3", ",", "1"}]], "==", 
     FractionBox["7", "4"]}],
    FontWeight->"Plain"], 
   StyleBox[",",
    FontWeight->"Plain"], 
   StyleBox[" ",
    FontWeight->"Plain"], 
   RowBox[{
    StyleBox[
     SubscriptBox["m", 
      RowBox[{"5", ",", "1"}]],
     FontWeight->"Plain"], 
    StyleBox["\[Equal]",
     FontWeight->"Plain"], 
    RowBox[{
     StyleBox[
      RowBox[{"2", 
       StyleBox[".",
        FontWeight->"Plain"]}]], 
     StyleBox[" ",
      FontWeight->"Plain"], 
     StyleBox["The",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["value",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["of",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["inconsistency",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["introduced",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["by",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["this",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["triad",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["is",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Plain"], 
     StyleBox[
      FractionBox["25", "32"],
      FontWeight->"Plain"]}]}]}], 
  StyleBox[" ",
   FontWeight->"Plain"], 
  StyleBox["*)",
   FontWeight->"Plain"]}]], "Input",
 CellChangeTimes->{{3.61096044220909*^9, 3.610960484360515*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"KoczkodajTheWorstTriad", "[", "M", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"5", ",", "3", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     FractionBox["1", "4"], ",", 
     FractionBox["7", "4"], ",", "2"}], "}"}], ",", 
   FractionBox["25", "32"]}], "}"}]], "Output",
 CellChangeTimes->{3.610960434485098*^9, 3.61096108703592*^9}]
}, Open  ]],

Cell[BoxData[
 StyleBox[
  RowBox[{"(*", " ", 
   RowBox[{
   "Perform", " ", "one", " ", "step", " ", "of", " ", "the", " ", 
    "Koczkodaj", " ", "inconsistency", " ", "reduction", " ", 
    RowBox[{"algorithm", ".", " ", "On"}], " ", "the", " ", "output", " ", 
    "there", " ", "is", " ", "a", " ", "new", " ", "slightly", " ", 
    "modified", " ", "matrix", " ", "M2", " ", "that", " ", "is", " ", 
    "expected", " ", "to", " ", "be", " ", "more", " ", "consistent", " ", 
    "than", " ", "M"}], " ", "*)"}],
  FontWeight->"Bold"]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"M2", " ", "=", " ", 
   RowBox[{"N", "[", 
    RowBox[{"KoczkodajImproveMatrixStep", "[", "M", "]"}], "]"}]}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
    "1.`", ",", "0.6`", ",", "0.3443060377393186`", ",", "0.625`", ",", 
     "0.8298265333662433`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
    "1.6666666666666667`", ",", "1.`", ",", "0.7142857142857143`", ",", 
     "2.5`", ",", "3.3333333333333335`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
    "2.904392866781852`", ",", "1.4`", ",", "1.`", ",", "3.5`", ",", 
     "2.4101422641752297`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
    "1.6`", ",", "0.4`", ",", "0.2857142857142857`", ",", "1.`", ",", 
     "1.3333333333333333`"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
    "1.2050711320876148`", ",", "0.3`", ",", "0.41491326668312173`", ",", 
     "0.75`", ",", "1.`"}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.6109605572109118`*^9, 3.610960569976719*^9}, 
   3.610961088252862*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{"KoczkodajIdx", "[", "M2", "]"}],
  FontWeight->"Plain"]], "Input"],

Cell[BoxData["0.5850867333168782`"], "Output",
 CellChangeTimes->{3.610960608784669*^9, 3.610961090390048*^9}]
}, Open  ]]
},
WindowSize->{838, 526},
WindowMargins->{{Automatic, 67}, {Automatic, 24}},
ShowSelection->True,
Magnification:>0.75 Inherited,
FrontEndVersion->"10.0 for Linux ARM (32-bit) (November 19, 2013)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "Info3610961044-2025015"->{
  Cell[4210, 119, 240, 4, 32, "Print",
   CellTags->"Info3610961044-2025015"]},
 "Info3610961047-2025015"->{
  Cell[4855, 144, 236, 4, 32, "Print",
   CellTags->"Info3610961047-2025015"],
  Cell[5094, 150, 1002, 27, 18, "Print",
   CellTags->"Info3610961047-2025015"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"Info3610961044-2025015", 58953, 1978},
 {"Info3610961047-2025015", 59062, 1981}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[557, 20, 3039, 70, 261, "Input"],
Cell[3599, 92, 144, 4, 23, "Input"],
Cell[3746, 98, 105, 3, 23, "Input"],
Cell[3854, 103, 232, 7, 37, "Input"],
Cell[CellGroupData[{
Cell[4111, 114, 96, 3, 23, "Input"],
Cell[4210, 119, 240, 4, 32, "Print",
 CellTags->"Info3610961044-2025015"]
}, Open  ]],
Cell[4465, 126, 243, 7, 23, "Input"],
Cell[CellGroupData[{
Cell[4733, 137, 97, 3, 23, "Input"],
Cell[CellGroupData[{
Cell[4855, 144, 236, 4, 32, "Print",
 CellTags->"Info3610961047-2025015"],
Cell[5094, 150, 1002, 27, 18, "Print",
 CellTags->"Info3610961047-2025015"]
}, Open  ]]
}, Open  ]],
Cell[6123, 181, 219, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[6367, 191, 100, 3, 23, "Input"],
Cell[6470, 196, 7924, 217, 153, "Print"]
}, Open  ]],
Cell[14409, 416, 201, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[14635, 426, 757, 23, 64, "Input"],
Cell[15395, 451, 396, 12, 36, "Output"]
}, Open  ]],
Cell[15806, 466, 224, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[16055, 476, 108, 3, 23, "Input"],
Cell[16166, 481, 112, 1, 23, "Output"]
}, Open  ]],
Cell[16293, 485, 225, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[16543, 495, 109, 3, 23, "Input"],
Cell[16655, 500, 352, 7, 23, "Output"]
}, Open  ]],
Cell[17022, 510, 326, 9, 23, "Input"],
Cell[CellGroupData[{
Cell[17373, 523, 97, 3, 23, "Input"],
Cell[17473, 528, 112, 1, 23, "Output"]
}, Open  ]],
Cell[17600, 532, 291, 7, 23, "Input"],
Cell[CellGroupData[{
Cell[17916, 543, 103, 3, 23, "Input"],
Cell[18022, 548, 452, 9, 23, "Output"]
}, Open  ]],
Cell[18489, 560, 265, 5, 23, "Input"],
Cell[CellGroupData[{
Cell[18779, 569, 131, 4, 23, "Input"],
Cell[18913, 575, 207, 5, 23, "Output"]
}, Open  ]],
Cell[19135, 583, 428, 9, 23, "Input"],
Cell[CellGroupData[{
Cell[19588, 596, 139, 4, 23, "Input"],
Cell[19730, 602, 212, 5, 23, "Output"]
}, Open  ]],
Cell[19957, 610, 3317, 96, 149, "Input"],
Cell[CellGroupData[{
Cell[23299, 710, 2467, 80, 74, "Input"],
Cell[25769, 792, 966, 35, 35, "Output"]
}, Open  ]],
Cell[26750, 830, 1965, 86, 23, "Input"],
Cell[CellGroupData[{
Cell[28740, 920, 2479, 80, 74, "Input"],
Cell[31222, 1002, 968, 34, 37, "Output"]
}, Open  ]],
Cell[32205, 1039, 283, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[32513, 1049, 1101, 32, 108, "Input"],
Cell[33617, 1083, 1026, 32, 36, "Output"]
}, Open  ]],
Cell[34658, 1118, 94, 1, 23, "Input"],
Cell[34755, 1121, 479, 9, 37, "Input"],
Cell[CellGroupData[{
Cell[35259, 1134, 226, 10, 64, "Input"],
Cell[35488, 1146, 287, 8, 23, "Output"]
}, Open  ]],
Cell[35790, 1157, 543, 13, 23, "Input"],
Cell[CellGroupData[{
Cell[36358, 1174, 261, 7, 23, "Input"],
Cell[36622, 1183, 316, 7, 23, "Output"]
}, Open  ]],
Cell[36953, 1193, 404, 9, 23, "Input"],
Cell[CellGroupData[{
Cell[37382, 1206, 258, 7, 23, "Input"],
Cell[37643, 1215, 252, 6, 23, "Output"]
}, Open  ]],
Cell[37910, 1224, 240, 6, 23, "Input"],
Cell[CellGroupData[{
Cell[38175, 1234, 206, 5, 23, "Input"],
Cell[38384, 1241, 272, 6, 23, "Output"]
}, Open  ]],
Cell[38671, 1250, 423, 9, 37, "Input"],
Cell[CellGroupData[{
Cell[39119, 1263, 123, 4, 23, "Input"],
Cell[39245, 1269, 95, 1, 23, "Output"]
}, Open  ]],
Cell[39355, 1273, 465, 11, 37, "Input"],
Cell[CellGroupData[{
Cell[39845, 1288, 123, 4, 23, "Input"],
Cell[39971, 1294, 96, 1, 23, "Output"]
}, Open  ]],
Cell[40082, 1298, 247, 5, 23, "Input"],
Cell[CellGroupData[{
Cell[40354, 1307, 131, 4, 23, "Input"],
Cell[40488, 1313, 108, 2, 23, "Output"]
}, Open  ]],
Cell[40611, 1318, 272, 5, 23, "Input"],
Cell[CellGroupData[{
Cell[40908, 1327, 131, 4, 23, "Input"],
Cell[41042, 1333, 11157, 387, 177, "Output"]
}, Open  ]],
Cell[52214, 1723, 296, 7, 23, "Input"],
Cell[CellGroupData[{
Cell[52535, 1734, 196, 5, 23, "Input"],
Cell[52734, 1741, 124, 2, 23, "Output"]
}, Open  ]],
Cell[52873, 1746, 3323, 138, 52, "Input"],
Cell[CellGroupData[{
Cell[56221, 1888, 111, 3, 23, "Input"],
Cell[56335, 1893, 336, 10, 36, "Output"]
}, Open  ]],
Cell[56686, 1906, 552, 11, 37, "Input"],
Cell[CellGroupData[{
Cell[57263, 1921, 180, 5, 23, "Input"],
Cell[57446, 1928, 885, 24, 37, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[58368, 1957, 102, 3, 23, "Input"],
Cell[58473, 1962, 110, 1, 23, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
